package com.itany.springcloud.config;

import com.itany.springcloud.config.bean.SomeBean;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
public class SpringcloudNacosConfigApplication {

    public static void main(String[] args) {

        ConfigurableApplicationContext ac=SpringApplication.run(SpringcloudNacosConfigApplication.class, args);

        String str=ac.getEnvironment().getProperty("some.str");
        String i=ac.getEnvironment().getProperty("some.i");

        System.out.println(str+"+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");
        System.out.println(i+"+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");

        SomeBean someBean= (SomeBean) ac.getBean("someBean");
        System.out.println(someBean.getStr()+"-----------------------------------------");
        System.out.println(someBean.getI()+"-----------------------------------------");

    }

}
